<?php

/**
* @Author:  	Daniel Dinh
* @Email:   	webdevelopmentvn@gmail.com
* @Link: 		http://www.joomsoft.net
* @Version: 	1.0
* @copyright:	Joomsoft.net
* @license:		Commercial
*/

// no direct access
defined('_JEXEC') or die;
?>
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
 <script>
 	jQuery(document).ready(function(){
	
		jQuery("#jform_fieldtype").change(function(){
			jQuery("#task").val("jsnfield.apply");
			jQuery("#client-form").submit();
		});
	});
 </script>
<form action="<?php echo JRoute::_('index.php?option=com_jsnplugin&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="client-form">
<table class="adminform">
	<tbody>
		<?php foreach($this->form->getFieldset() as $field): ?>
			<tr>
				<td width="15%"><?php echo $field->label;?></td>
				<td><?php echo $field->input;?></td>
			</tr>
		<?php endforeach; ?>
		<?php if($this->extrafields) :?>
			<?php foreach($this->extrafields as $key=>$ef):
					if(!in_array($key,array('type','name'))):
				?>
				<tr>
					<td width="15%"><?php echo ucfirst($key);?></td>
					<td><?php echo $ef;?></td>
				</tr>
			
			<?php 
			endif;
			endforeach;?>
		<?php endif;?>
		
	</tbody>	
	</table>	
	<input type="hidden" name="datafieldid" value="<?php echo $this->datafield->id;?>" />
	<input type="hidden" name="task" value="jsnfield.edit" id="task"/>
	<?php echo JHtml::_('form.token'); ?>
</form>
